#绝对布局  窗口指定每一个控件显示的坐标和大小来布局的
import sys
from  PyQt5.QtWidgets import *
class Example(QWidget):
    def __init__(self,parent=None):
        super(Example,self).__init__(parent)
        self.setWindowTitle("伸缩")
        btn1=QPushButton(self)
        btn2 = QPushButton(self)
        btn3 = QPushButton(self)
        btn1.setText("b1")
        btn2.setText("b2")
        btn3.setText("b3")
        hbox=QHBoxLayout()
        hbox.addStretch(1)
        hbox.addWidget(btn1)
        hbox.addStretch(2)
        hbox.addWidget(btn2)
        hbox.addStretch(3)
        hbox.addWidget(btn3)
        self.setLayout(hbox)
if __name__ == '__main__':
    app=QApplication(sys.argv)
    demo=Example()
    demo.show()
    sys.exit(app.exec_())
